
<form id="form" action="{:url('manage.unmarket/edit')}">
<input type="hidden" name="id" value="{$info.id}"/>
<div class="titlebar fn-clear">
    <div class="fn-left"><i class="iconfont icon-my_icon"></i><span class="fn-fb">客服信息</span> <span class="gray fn-f12">客服联系方式</span></div>    
</div>
<table class="formtable">
    <tr>
        <th>客服手机号:</th>
        <td><input class="input w200" datatype="*" type="text" name="telphone" value="{$info.telphone}" /></td>
    </tr>
    <tr>
        <th>客服二维码:</th>
        <td><input id="mycode" readonly class="input w500 ui-upload readonly" datatype="*" type="text" name="mycode" value="{$info.mycode}" /></td>
    </tr>
    <tr>
        <th>友情提示:</th>
        <td><input class="input w500" datatype="*" type="text" name="tips" value="{$info.tips}" /></td>
    </tr>
</table>
<div class="titlebar fn-clear">
    <div class="fn-left"><i class="iconfont icon-my_icon"></i><span class="fn-fb">福利规则</span></div>    
</div>
<div class="tipbox tipbox-message">
<span class="fn-f14 fn-fb red">注意事项</span> <span class="gray fn-f12">结算到服务商默认账户,如联盟城市活动,需联系运营方申请线下结算。</span><br />
1、所有资金结算到默认商户号（财务管理->商户入件->默认账户）<br />
2、商家的钱付款到零钱结算、用户奖励用红包发送结算。
</div>  
<table class="formtable">
    <tr><th>价格(￥):</th><td><input class="input" datatype="npot" type="text" name="price" value="{$info.price}" /></td></tr>
    <tr><th>发送方式:</th><td>
        <input class="radio" type="radio" name="bonus_types" value="0" {if $info.bonus_types == 0}checked="true"{/if}> 随机红包
        <input class="radio" type="radio" name="bonus_types" value="1" {if $info.bonus_types == 1}checked="true"{/if}> 固定额度
    </td></tr>
    <tr><th>红包对象:</th><td>
        <span class="badge bg-blue"><input class="radio" type="radio" name="bonus_user_types" value="0" {if $info.bonus_user_types == 0}checked="true"{/if}> 所有用户</span>
        <span class="badge bg-yellow"><input class="radio" type="radio" name="bonus_user_types" value="1" {if $info.bonus_user_types == 1}checked="true"{/if}> 下单会员</span>
        <span class="badge bg-green"><input class="radio" type="radio" name="bonus_user_types" value="2" {if $info.bonus_user_types == 2}checked="true"{/if}> 所有用户/下单会员</span>
    </td></tr>
    <tr class="share{if $info.bonus_user_types == 1} fn-hide{/if}"><th>普通红包:</th><td><input class="input" datatype="npot" type="text" name="share_ratio" value="{$info.share_ratio}" /> <span class="share_ratio red">{$info.bonus_types?'￥':'%'}</span></td></tr>
    <tr class="share_user{if $info.bonus_user_types == 0} fn-hide{/if}"><th>会员红包:</th><td><input class="input" datatype="n" type="text" name="share_ratio_user" value="{$info.share_ratio_user}" /> <span class="share_ratio red">{$info.bonus_types?'￥':'%'}</span></td></tr>
    <th>商家微信:</th>
    <td>
        <input readonly="readonly" id="uid" class="readonly input w100" type="text" name="uid" value="{$info.uid}" />
        <button url="{:url('allwin/store/selectStoreManage',['input' => 'uid'])}" type="button" class="selectid button"><i class="iconfont icon-my_icon"></i>选择用户</button>
        <span class="gray">0:不通过付款到零钱结算给当前用户</span>
    </td>
</table>
<div class="titlebar fn-clear">
    <div class="fn-left"><i class="iconfont icon-my_icon"></i><span class="fn-fb">活动信息</span></span></div>    
</div>
<table class="formtable">
    <tr>
        <th>开始时间:</th>
        <td>
            <input readonly="true" class="input readonly ui-time" datatype="date" type="text" name="start_time" value="{$info.start_time|date='Y-m-d H:i:s'}" /> - 
            <input readonly="true" class="input readonly ui-time" datatype="date" type="text" name="end_time" value="{$info.end_time|date='Y-m-d H:i:s'}" />
        </td>
    </tr>
    <tr>
        <th>内容标题:</th>
        <td><input class="input w500" datatype="*" type="text" name="title" value="{$info.title}" /></td>
    </tr>
    <tr>
        <th>分享主图:</th>
        <td><input id="share_img" readonly class="input w500 ui-upload readonly" datatype="*" type="text" name="share_img" value="{$info.share_img}" /></td>
    </tr>
    <tr>
        <th>分享标题:</th>
        <td><input class="input w500" datatype="*" type="text" name="share_title" value="{$info.share_title}" /></td>
    </tr>
    <tr>
        <th>分享内容:</th>
        <td><input class="input w500" datatype="*" type="text" name="share_text" value="{$info.share_text}" /></td>
    </tr>
    <tr>
        <th>背景音乐:</th>
        <td><input id="music" readonly class="input w500 ui-upload readonly" datatype="*" data="setMusic" type="text" name="music" value="{$info.music}" /></td>
    </tr>
    <tr><th>活动须知:</th><td><div class="w500"><textarea name="note" class="textarea ui-mieditor">{$info.note|dehtml}</textarea></div></td></tr>
    <tr>
        <th>
            <input type="hidden" name="img" id="img_index"  value="{$info.img}" />
            <button url="{:url('system/passport.common/upload')}" type="button" class="button selectid"><i class="iconfont icon-pic"></i>选择图片</button>
        </th>
        <td id="imgbox">
            {foreach $info.imgs as $pic}
            <div class="box-view fn-left fn-cp{if $info.img == $pic} current{/if}">
                <input type="hidden" name="imgs[]" value="{$pic}" /><img src="{$pic}" onclick="selectImg(this)">
                <div class="opera">
                    <a class="imgbox-left" href="javascript:;"><i class="iconfont icon-arrowleft"></i></a>
                    <a class="imgbox-right" href="javascript:;"><i class="iconfont icon-arrowright"></i></a>
                    <a class="imgbox-link" href="javascript:;" onclick="linkImg(this)"><i class="iconfont icon-pic"></i></a>
                    <a class="imgbox-close" href="javascript:;" onclick="delImg(this)"><i class="iconfont icon-cuowu"></i></a>
                </div>
            </div>
            {/foreach}
        </td>
    </tr>
    <tr>
        <th></th>
        <td>
            <input type="submit" value="确定" class="button button-blue submit" />
            <input type="reset" value="重置" class="button button-blank"/>
        </td>
    </tr>
</table>
</div>
</form>
<script type="text/javascript">
Do('base','layer','form','editor','date',function () {
    $('#form').isForm({'upload':'{:url("system/passport.common/upload")}'});
    $(".selectid").win();
    bindEvent();
    $("input[name='bonus_types']").click(function(){
        var bonus_types = $(this).val();
        0==bonus_types?$(".share_ratio").text('%'):$(".share_ratio").text('￥');
    });    
    $("input[name='bonus_user_types']").click(function(){
        var bonus_user_types = parseInt($(this).val());
        switch (bonus_user_types) {
            case 1:
                $(".share").hide();
                $(".share_user").show();
                break;
            case 2:
                $(".share").show();
                $(".share_user").show();
                break;
            default:
                $(".share").show();
                $(".share_user").hide();
                break;
        }
    });
})
//添加图片
function mycode(value){
    $("#mycode").val(value);
}
function share_img(value){
    $("#share_img").val(value);
}
function setMusic(value){
    $("#music").val(value);
}
</script>